package com.dex4d.model;

import com.dex4d.BuildConfig;

/**
 * Created by chengyuchun on 2018/11/28.
 */
public class D4DTxLogModel {

    //服务端要的精确类型数据，不要修改
    public enum TradeType {
        BUY(0,"buy","买入"),
        SELL(1,"sell","卖出"),
        REINVEST(2,"reinvest","再投资"),
        SWAP(3,"swap","对倒"),
        WITHDRAW(4,"withdraw","提现"),
        APPROVE(5,"approve","approve"),
        BUYREFERRAL(6,"buyreferral","购买推荐权限"),
        BUYSWAP(7,"buyswap","购买对倒权限");

        private int index;
        private String type;
        private String name;

        private TradeType(int index,String type,String name) {
            this.index = index;
            this.type = type;
            this.name = name;
        }

        public String getType(){
            return type;
        }

        public String getName(){
            return name;
        }
    }

    //服务端要的精确状态数据，不要修改
    public enum TxStatus {
        PENDING(0,"pending"),
        SUCCESS(1,"success"),
        FAILED(2,"failed");

        private int index;
        private String status;

        private TxStatus(int index,String status) {
            this.index = index;
            this.status = status;
        }

        public String getStatus(){
            return status;
        }
    }

    public D4DTxLogModel(TradeType type){
        desc = type.getType();
        account = User.getInstance().getAddress();
        from = User.getInstance().getAddress();
        chainId = BuildConfig.CHAIN_ID;
        referrer = BuildConfig.ADDRESS_X0; //暂时这么写，以后修改
    }

    public String account;
    public String symbol;  //业务给
    public String amountA; //业务给
    public String amountB; //业务给
    public String swapA;   //业务给
    public String swapB;   //业务给
    public int chainId;
    public String txHash;  //业务给
    public String from;
    public String to;      //业务给
    public String data;    //业务给
    public String gasPrice;//业务给
    public String gasLimit;//业务给
    public String desc;
    public String referrer;
}
